#
server {
  listen {{ ansible_default_ipv4.address }}:{{ ngx_port_http }} default_server;
  server_name _;
  # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
  return 301 https://$host$request_uri;
}

{% if exporter_is_install | bool %}
server {
  listen 127.0.0.1:{{ ngx_port_api }};
  server_name _;
  location /api {
    stub_status on;
    allow 127.0.0.1;
    access_log off;
    deny all;
  }
}
{% endif %}
